package model;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class Busca {
	
	public Departamento Buscar(int i){
		Departamento d;
		EntityManagerFactory emf =Persistence.createEntityManagerFactory("default");
		EntityManager em = emf.createEntityManager();

		em.getTransaction().begin();
		
		d= em.find(Departamento.class, i);
		em.getTransaction().commit();
		
		emf.close ();
		em.close();
		return d;
		
		}


}
